package com.gitee.wsl.doc.prosemirror.history.ext

import com.gitee.wsl.doc.prosemirror.history.bean.HistoryState
import com.gitee.wsl.doc.prosemirror.history.mapRanges
import com.gitee.wsl.doc.prosemirror.state.Transaction

fun HistoryState.rebased(
                        tr: Transaction,
                        rebased:Int
) = HistoryState(
    done.rebased(tr, rebased),
    undone.rebased(tr, rebased),
    mapRanges(prevRanges, tr.mapping),
    prevTime,
    prevComposition
)